package com.skeeey.aim.action.record;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;

import com.skeeey.aim.action.BaseAction;
import com.skeeey.aim.model.AutoRecord;
import com.skeeey.aim.model.Dealer;
import com.skeeey.aim.model.Role;
import com.skeeey.aim.model.User;
import com.skeeey.aim.model.Workload;
import com.skeeey.aim.model.statistics.StatisticRecord;
import com.skeeey.aim.service.RecordService;
import com.skeeey.aim.util.AIMUtil;
import com.skeeey.aim.util.CreateStatisticExcel;
import com.skeeey.aim.util.QuarterStatistic;
import com.skeeey.aim.util.UNZipUtil;
import com.skeeey.aim.util.VINStatistic;
import com.skeeey.aim.util.WorkloadStatistic;
import com.skeeey.aim.util.ZipDir;

public class RecordAction extends BaseAction {
	private static final long serialVersionUID = 1L;
	
	private Logger logger = Logger.getLogger(RecordAction.class);
	
	private File originalFile;
	
	private String suffix;
	
	private String vinImageFileFileName;
	
	private File vinImageFile;
	
	private long uTimeStamp;
	
	private String uToken;
	
	private int recordStatus;
	
	private String timeStamp;
	
	private String recordsJOSNStr;
	
	private String recordId;
	
	private String jsonstrRecord;
	
	private String dealerCode;
	
	private long createTime;
	
	private int index;
	
	private File statisticFile;

	private RecordService recordService;
	
	private String imgType;
	
	private String fsName;
	
	private int provedType;
	
	private String provedDataFileName;
	
	private File provedData;
	
	private String year;
	
	private int quarter;
	
	public String toUploadOriginalData() {
		return SUCCESS;
	}
	
	/* handle original data file */
	public String uploadOriginalData() {
		if(originalFile == null) {
			addActionError(getText("error.upload.original.data"));
			return INPUT;
		}
		
		if(dealerCode == null || dealerCode.length() == 0) {
			addActionError(getText("原始清单名称错误， 经销商网络代码不存在"));
			return INPUT;
		}
		
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer == null) {
			addActionError(getText("原始清单名称错误， 经销商网络代码不存在"));
			return INPUT;
		}
		
		Date uploadDate = new Date();
		createTime = uploadDate.getTime();
		SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd");
		timeStamp = format.format(uploadDate);
		try {
			List<AutoRecord> records = AIMUtil.getAutoRecordFrom(originalFile, suffix, timeStamp, dealerCode, createTime);
			
			if(records.isEmpty()) {
				addActionError(getText("error.upload.original.data"));
				return INPUT;
			}
			
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			File stroragePath = new File(dataStroragePath);
			// create a directory to store records and VIN images
			if(!stroragePath.exists()) {
				stroragePath.mkdirs();
			}
			File destFile = new File(dataStroragePath + File.separator + "上海大众-" + dealer.getNetCode()+ "-" + dealer.getShortName() + "-原始清单.xls");
			if(!destFile.exists()) {
				// save records to DB
				recordService.saveOriginalRecords(records);
			} else {
				recordService.updateOriginalRecords(records, timeStamp);
			}
			
			if(destFile.exists()) {
					FileUtils.forceDelete(destFile);
			}
			FileUtils.moveFile(originalFile, destFile);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError("系统忙, 上传原始清单失败, 请稍候再试...");
			return INPUT;
		}
		
		session.setAttribute("dealerCode", dealerCode);
		session.setAttribute("timeStamp", timeStamp);
		session.setAttribute("createTime", createTime);
		return SUCCESS;
	}
	
	public String toDataSynch() {
		return SUCCESS;
	}
	
	public String doDataSynch() throws Exception {
		if(originalFile == null) {
			addActionError(getText("error.upload.original.data"));
			return INPUT;
		}
		
		if(dealerCode == null || dealerCode.length() == 0) {
			addActionError(getText("同步数据名称错误， 经销商网络代码不存在"));
			return INPUT;
		}
		
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer == null) {
			addActionError(getText("同步数据名称错误， 经销商网络代码不存在"));
			return INPUT;
		}
		String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
		File stroragePath = new File(dataStroragePath);
		if(!stroragePath.exists()) {
			stroragePath.mkdirs();
		}
		if(UNZipUtil.unZip(originalFile, dataStroragePath)) {
			File originalDataFile = null;
			for(File file : stroragePath.listFiles()) {
				if(file.getName().contains("上海大众-" + dealer.getNetCode()+ "-" + dealer.getShortName() + "-原始清单")) {
					originalDataFile = file;
					break;
				}
			}
			if(originalDataFile != null) {
				SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd");
				long createTime = format.parse(timeStamp).getTime();
				String suffix = originalDataFile.getName().split("[.]")[1];
				List<AutoRecord> records = AIMUtil.getAutoRecordFrom(originalDataFile, suffix, timeStamp, dealerCode, createTime);
				recordService.updateOriginalRecords(records, timeStamp);
			} else {
				addActionError(getText("同步数据中未发现原始清单"));
				return INPUT;
			}
		} else {
			addActionError(getText("解压同步数据错误， 请检查同步数据"));
			return INPUT;
		}
		
		addActionMessage("同步数据成功");
		return SUCCESS;
	}
	
	
	public String toGetRecordTabs() {
		return SUCCESS;
	}
	
	public String getRecordsByStatus() {
		String timeStamp = (String)session.getAttribute("timeStamp");
		List<AutoRecord> records = recordService.getAutoRecordsBy(recordStatus, timeStamp, dealerCode);
		recordsJOSNStr = AIMUtil.toJSONArrayStr(records);
		return SUCCESS;
	}
	
	public String updateRecord() {
		AutoRecord record = AIMUtil.toAutoRecordBy(jsonstrRecord);
		if(record != null) {
			recordService.updateOriginalRecord(record);
		}
		sendResult(0, null);
		return null;
	}
	
	public String deleteRecord() {
		recordService.deletOriginalRecordBy(recordId);
		sendResult(0, null);
		return null;
	}
	
	/* upload images */
	public String toUploadVINImages() {
		uTimeStamp = session.getCreationTime();
		uToken = AIMUtil.getMD5("owdjskj" + uTimeStamp);
		if(session.getAttribute("dealerCode") != null && session.getAttribute("timeStamp") != null) {
			dealerCode = (String)session.getAttribute("dealerCode");
			timeStamp = (String) session.getAttribute("timeStamp");
		}
		return SUCCESS;
	}
	
	public String toUploadProvedData() {
		uTimeStamp = session.getCreationTime();
		uToken = AIMUtil.getMD5("owdjskj" + uTimeStamp);
		if(session.getAttribute("dealerCode") != null && session.getAttribute("timeStamp") != null) {
			dealerCode = (String)session.getAttribute("dealerCode");
			timeStamp = (String) session.getAttribute("timeStamp");
		}
		return SUCCESS;
	}
	
	public String uploadVINImage() {
		int resultCode = 1;
		if(AIMUtil.getMD5("owdjskj" + uTimeStamp).equals(uToken)) {
			try {
				Dealer dealer = recordService.findDealerBy(dealerCode);
				if(dealer != null) {
					String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
					File stroragePath = new File(dataStroragePath);
					if(stroragePath.exists()) {
						String vinImageFileName = vinImageFileFileName.substring(vinImageFileFileName.indexOf(".") - 6);
						File image = AIMUtil.saveVINFileToTemp(vinImageFileName, vinImageFile);
						String vinCode = AIMUtil.getVINCodeBy(vinImageFileName);
						AutoRecord autoRecord = recordService.findAutoRecordBy(dealer.getNetCode(), vinCode);
						AIMUtil.saveVINImage(autoRecord, dataStroragePath, dealer, vinImageFileName, image, imgType, fsName);
						resultCode = 0;
					} else {
						resultCode = 4;
					}
				} else {
					// dealer is not existent
					resultCode = 3;
				}
			} catch (Exception e) {
				logger.error("vin image file upload failed!!", e);
				resultCode = 2;
			}
		}
		sendResult(resultCode, null);
		return null;
	}
	
	public String uploadProvedData() {
		int resultCode = 1;
		if(AIMUtil.getMD5("owdjskj" + uTimeStamp).equals(uToken)) {
			try {
				Dealer dealer = recordService.findDealerBy(dealerCode);
				if(dealer != null) {
					String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
					File stroragePath = new File(dataStroragePath);
					if(stroragePath.exists()) {
						AIMUtil.saveProvedFile(provedData, dataStroragePath, provedType, provedDataFileName);
						resultCode = 0;
					} else {
						resultCode = 4;
					}
				} else {
					// dealer is not existent
					resultCode = 3;
				}
			} catch (Exception e) {
				logger.error("proved file upload failed!!", e);
				resultCode = 2;
			}
		}
		sendResult(resultCode, null);
		return null;
	}
	
	public String validDealerCode() {
		int resultCode = 1;
		if(recordService.isValidDealer(dealerCode)) {
			resultCode = 0;
		}
		sendResult(resultCode, null);
		return null;
	}
	
	public String getDealerName() {
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			sendResult(0, dealer.getShortName());
		}
		sendResult(1, null);
		return null;
	}
	
	public String validTimeStamp() {
		int resultCode = 1;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			File stroragePath = new File(dataStroragePath);
			if(stroragePath.exists()) {
				resultCode = 0;
			} else {
				resultCode = 2;
			}
		}
		sendResult(resultCode, null);
		return null;
	}
	
	/*generate statistics file*/
	public String getStroragePaths() {
		int resultCode = 1;
		String directories = null;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, "");
			File stroragePath = new File(dataStroragePath);
			if(stroragePath.exists()) {
				List<String> dirs = AIMUtil.getSubDirs(stroragePath);
				directories = dirs.toString().replaceAll("\\[","").replaceAll("\\]", "").replaceAll(" ", "").replaceAll("\r", "").replaceAll("\n", "");
				resultCode = 0;
			} else {
				resultCode = 2;
			}
		}
		sendResult(resultCode, directories);
		return null;
	}
	
	public String statisticsFileExist() {
		int resultCode = 1;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			File stroragePath = new File(dataStroragePath);
			if(stroragePath.exists()) {
				String sFileName = dataStroragePath + File.separator + "上海大众库存信息整理表" + dealer.getNetCode() + "-" + dealer.getShortName() + "-" + timeStamp + ".xls";
				File sFile = new File(sFileName);
				if(sFile.exists()) {
					// copy the statistics file to tmp directory
					File tmpFile = new File(AIMUtil.getSystemConfig("execl.temp.path") + File.separator + dealer.getNetCode() + "-" + timeStamp + ".xls");
					session.setAttribute("statisticFileName", sFileName);
					session.setAttribute("statisticTmpFileName", AIMUtil.getSystemConfig("execl.temp.path") + File.separator + dealer.getNetCode() + "-" + timeStamp + ".xls");
					try {
						FileUtils.copyFile(sFile, tmpFile);
					} catch (IOException e) {
						logger.warn("Copy statistics file to tmp directory failed, try again...");
						try {
							FileUtils.forceDelete(tmpFile);
							FileUtils.copyFile(sFile, tmpFile);
						} catch (IOException e1) {
							logger.warn("Copy statistics file to tmp directory failed!!", e1);
						}
					}
					resultCode = 0;
				} else {
					resultCode = 3;
				}
			} else {
				resultCode = 2;
			}
		}
		sendResult(resultCode, null);
		return null;
	}
	
	/*delete data*/
	public String toOperatorDelete() {
		dealerCode = (String)session.getAttribute("dealerCode");
		timeStamp = (String) session.getAttribute("timeStamp");
		return SUCCESS;
	}
	
	public String toDelete() {
		return SUCCESS;
	}
	
	public String deleteData() {
		int resultCode = 1;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			Role role = (Role)session.getAttribute("role");
			if("admin".equals(role.getName())) {
				File file = new File(dataStroragePath);
				if(file.exists() && file.isDirectory()) {
					try {
						FileUtils.deleteDirectory(file);
						//delete original data from DB
						recordService.deletOriginalRecords(dealer.getNetCode(), timeStamp);
						resultCode = 0;
					} catch (IOException e) {
					}
				}
			} else {
				String name = AIMUtil.getDirName(dataStroragePath, provedType, fsName);
				if(name != null) {
					File file = new File(name);
					if(file.exists() && file.isDirectory()) {
						try {
							FileUtils.deleteDirectory(file);
							resultCode = 0;
						} catch (IOException e) {
						}
					} else {
						resultCode = 2;
					}
				} else {
					resultCode = 2;
				}
			}
		}
		if(resultCode == 0) {
			//TODO: delete the related workload
			System.out.println("Debug:: delete workload:" + dealer.getShortName() + "," + timeStamp);
			recordService.deletOriginalRecords(dealer.getShortName(), timeStamp);
		}
		sendResult(resultCode, null);
		return null;
	}
	
	public String toSatusList() {
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			recordsJOSNStr = AIMUtil.toJSONArrayStr(recordService.getStatisticRecordsBy(index, dealer, timeStamp));
		}
		return SUCCESS;
	}
	
	public String toStatistics() {
		return SUCCESS;
	}
	
	public String toOperatorStatistics() {
		dealerCode = (String)session.getAttribute("dealerCode");
		timeStamp = (String)session.getAttribute("timeStamp");
		return SUCCESS;
	}
	
	public String createStatistic() {
		int resultCode = 1;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			StatisticRecord sr = recordService.createStatisticRecordBy(dealer, timeStamp);
			sr.setUserName(((User)session.getAttribute("user")).getName());
			String dataStroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			File stroragePath = new File(dataStroragePath);
			if(stroragePath.exists()) {
				try {
					String statisticFileName = stroragePath + File.separator + "上海大众库存信息整理表" + dealer.getNetCode() + "-" + dealer.getShortName() + "-" + timeStamp + ".xls";
					CreateStatisticExcel.createStatisticExcel(sr, statisticFileName, timeStamp);
					session.setAttribute("statisticFileName", statisticFileName);
					session.setAttribute("statisticTmpFileName", AIMUtil.getSystemConfig("execl.temp.path") + File.separator + dealer.getNetCode() + "-" + timeStamp + ".xls");
					resultCode = 0;
				} catch (IOException e) {
					logger.error("create statistic file failed!!", e);
					resultCode = 3;
				}
			} else {
				resultCode = 2;
			}
		}
		sendResult(resultCode, null);
		return null;
	}
	
	public String updateStatisticFile() {
		String jsonStr = "1";
		
		if(AIMUtil.isValidStatisticFile(statisticFile)) {
			String statisticFileName = (String)session.getAttribute("statisticFileName");
			String statisticTmpFileName = (String)session.getAttribute("statisticTmpFileName");
			File sFile = new File(statisticFileName);
			try {
				if(sFile.exists()) {
					//FileUtils.forceDelete(sFile);
					//update statistic file
					FileUtils.copyFile(statisticFile, sFile);
					// copy the statistics file to tmp directory
					FileUtils.copyFile(sFile, new File(statisticTmpFileName));
					jsonStr = "0";
				} else {
					jsonStr = "3";
				}
			} catch (IOException e) {
				logger.warn("Update statistics file to tmp directory failed, try again...");
				jsonStr = "2";
			}
		}
		
		sendResult(jsonStr);
		return null;
	}

	/* download files*/
	public String toDownload() {
		return SUCCESS;
	}
	
	public String toOperatorDownload() {
		dealerCode = (String)session.getAttribute("dealerCode");
		timeStamp = (String)session.getAttribute("timeStamp");
		return SUCCESS;
	}
	
	public String prepDownloadFile() {
		int resultCode = 1;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String stroragePath = AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			ZipDir.zip(stroragePath, dealer.getNetCode() + "-" + dealer.getShortName() + "-" + timeStamp);
			resultCode = 0;
		}
		sendResult(resultCode, null);
		return null;
	}
	
	/*statistic*/
	public String toQStatistic() {
		return SUCCESS;
	}
	
	public String doQStatistic() {
		int resultCode = 0;
		String msg = null;
		System.out.println("-->" + year + ":" + quarter);
		try {
			QuarterStatistic qs = new QuarterStatistic();
			qs.doStatistic(year, quarter);
		} catch(IllegalArgumentException e) {
			resultCode = 1;
			msg = e.getMessage();
		} catch (IOException e) {
			resultCode = 1;
			msg = "IO错误！！";
		}
		sendResult(resultCode, msg);
		return null;
	}
	
	public String toVINStatistic() {
		return SUCCESS;
	}
	
	public String doVINStatistic() {
		int resultCode = 0;
		String msg = null;
		try {
			List<Dealer> dealers = recordService.getAllDealers();
			VINStatistic qs = new VINStatistic();
			qs.doStatistic(year, quarter, dealers);
		} catch(IllegalArgumentException e) {
			resultCode = 1;
			msg = e.getMessage();
		} catch (IOException e) {
			resultCode = 1;
			msg = "IO错误！！";
		}
		sendResult(resultCode, msg);
		return null;
	}
	
	public String toWorkloadStatistic() {
		return SUCCESS;
	}
	
	public String checkWorkloadFile() {
		int resultCode = -1;
		String msg = null;
		WorkloadStatistic wls = new WorkloadStatistic();
		String fileName = wls.checkWorkloadFile(year, quarter);
		if(fileName == null) {
			resultCode = 1;
			msg = "您还未上传该季度的盘库行程排期表，请先上传盘库行程排期表！";
		} else {
			resultCode = 0;
			msg = fileName;
		}
		sendResult(resultCode, msg);
		return null;
	}
	
	private String workloadFileName;
	public String doWorkloadStatistic() {
		File workloadFile = new File(AIMUtil.getSystemConfig("data.storage.path") + File.separator + "workload" + File.separator + 
				workloadFileName);
		String[] params_0 = workloadFileName.split("-");
		String[] params_1 = params_0[1].split("[.]");
		WorkloadStatistic wls = new WorkloadStatistic();
		recordsJOSNStr = AIMUtil.toJSONArrayStr(wls.doWorkloadStatistic(workloadFile,
				params_1[1],
				recordService.getWorkloads(params_0[0], params_1[0])));
		year = params_0[0];
		quarter = Integer.valueOf(params_1[0]);
		return SUCCESS;
	}
	
	public String uploadWorkloadFile() {
		if(originalFile == null) {
			addActionError("上传盘库行程排期表失败, 请检查文件是否正确.");
			return INPUT;
		}
		
		try {
			File destFile = new File(AIMUtil.getSystemConfig("data.storage.path") + File.separator + "workload" + File.separator + 
					year + "-" + quarter + "." + suffix);
			if(destFile.exists()) {
					FileUtils.forceDelete(destFile);
			}
			FileUtils.moveFile(originalFile, destFile);
			WorkloadStatistic wls = new WorkloadStatistic();
			recordsJOSNStr = AIMUtil.toJSONArrayStr(wls.doWorkloadStatistic(destFile, 
					suffix,
					recordService.getWorkloads(year, String.valueOf(quarter))));
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError("系统忙, 上传盘库行程排期表失败, 请稍候再试...");
			return INPUT;
		}
		return SUCCESS;
	}
	
	private String userName;
	public String toPlanWork() {
		String s = "xlsx";
		File destFile = new File(AIMUtil.getSystemConfig("data.storage.path") + File.separator + "workload" + File.separator + 
				year + "-" + quarter + ".xlsx");
		if(!destFile.exists()) {
			s = "xls";
			destFile = new File(AIMUtil.getSystemConfig("data.storage.path") + File.separator + "workload" + File.separator + 
					year + "-" + quarter + ".xls");
		}
		WorkloadStatistic wls = new WorkloadStatistic();
		recordsJOSNStr = AIMUtil.toJSONArrayStr(wls.getPlanWorks(destFile, s, userName));
		return SUCCESS;
	}
	
	public String toFinishedWork() {
		WorkloadStatistic wls = new WorkloadStatistic();
		recordsJOSNStr = AIMUtil.toJSONArrayStr(wls.getFinishedWork(
				recordService.getWorkloads(userName, year, String.valueOf(quarter))));
		return SUCCESS;
	}
	
	public String toWorkFinish() {
		return SUCCESS;
	}
	
	private String finishDate;
	public String doWorkFinish() {
		String[] times = finishDate.split("-");
		String q = AIMUtil.getQuarterByMonth(times[1]);
		Dealer dealer = recordService.findDealerBy(dealerCode);
		User user = (User) session.getAttribute("user");
		Workload workload = new Workload();
		workload.setAccount(user.getAccount());
		workload.setUserName(userName);
		workload.setDealerName(dealer.getShortName());
		workload.setFinishDate(finishDate);
		workload.setYear(times[0]);
		workload.setQuarter(q);
		recordService.saveWorkload(workload);
		WorkloadStatistic wls = new WorkloadStatistic();
		recordsJOSNStr = AIMUtil.toJSONArrayStr(wls.getFinishedWork(
				recordService.getWorkloads(userName, times[0], q)));
		return SUCCESS;
	}
	
	/* view out of system record*/
	public String toViewOutOfSystemRecord() {
		return SUCCESS;
	}
	
	public String viewOutOfSystemRecord() {
		int resultCode = 1;
		String msg = null;
		Dealer dealer = recordService.findDealerBy(dealerCode);
		if(dealer != null) {
			String dataStoragePathStr =  AIMUtil.findDataStoragePathStrBy(dealer, timeStamp);
			File dataStoragePath = new File(dataStoragePathStr + File.separator + "系统外");
			if(dataStoragePath.isDirectory() && dataStoragePath.exists()) {
				String[] fileNames = dataStoragePath.list();
				if(fileNames != null && fileNames.length > 0) {
					resultCode = 0;
					msg = fileNames[0];
					for(int i = 1; i < fileNames.length; i++) {
						msg = msg + "," + fileNames[i];
					}
				}
			}
		}
		sendResult(resultCode, msg);
		return null;
	}
	
	/* getter and setter */
	public File getOriginalFile() {
		return originalFile;
	}

	public void setOriginalFile(File originalFile) {
		this.originalFile = originalFile;
	}

	public String getRecordsJOSNStr() {
		return recordsJOSNStr;
	}

	public void setRecordsJOSNStr(String recordsJOSNStr) {
		this.recordsJOSNStr = recordsJOSNStr;
	}

	public String getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(String timeStamp) {
		this.timeStamp = timeStamp;
	}

	public int getRecordStatus() {
		return recordStatus;
	}

	public void setRecordStatus(int recordStatus) {
		this.recordStatus = recordStatus;
	}

	public String getRecordId() {
		return recordId;
	}

	public void setRecordId(String recordId) {
		this.recordId = recordId;
	}

	public long getUTimeStamp() {
		return uTimeStamp;
	}

	public void setUTimeStamp(long uTimeStamp) {
		this.uTimeStamp = uTimeStamp;
	}

	public String getUToken() {
		return uToken;
	}

	public void setUToken(String uToken) {
		this.uToken = uToken;
	}

	public File getVinImageFile() {
		return vinImageFile;
	}

	public void setVinImageFile(File vinImageFile) {
		this.vinImageFile = vinImageFile;
	}

	public String getVinImageFileFileName() {
		return vinImageFileFileName;
	}

	public void setVinImageFileFileName(String vinImageFileFileName) {
		this.vinImageFileFileName = vinImageFileFileName;
	}
	
	public String getJsonstrRecord() {
		return jsonstrRecord;
	}

	public void setJsonstrRecord(String jsonstrRecord) {
		this.jsonstrRecord = jsonstrRecord;
	}

	public String getDealerCode() {
		return dealerCode;
	}

	public void setDealerCode(String dealerCode) {
		this.dealerCode = dealerCode;
	}

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getSuffix() {
		return suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public File getStatisticFile() {
		return statisticFile;
	}

	public void setStatisticFile(File statisticFile) {
		this.statisticFile = statisticFile;
	}

	public String getImgType() {
		return imgType;
	}

	public void setImgType(String imgType) {
		this.imgType = imgType;
	}

	public String getFsName() {
		return fsName;
	}

	public void setFsName(String fsName) {
		this.fsName = fsName;
	}

	public int getProvedType() {
		return provedType;
	}

	public void setProvedType(int provedType) {
		this.provedType = provedType;
	}

	public String getProvedDataFileName() {
		return provedDataFileName;
	}

	public void setProvedDataFileName(String provedDataFileName) {
		this.provedDataFileName = provedDataFileName;
	}

	public File getProvedData() {
		return provedData;
	}

	public void setProvedData(File provedData) {
		this.provedData = provedData;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public int getQuarter() {
		return quarter;
	}

	public void setQuarter(int quarter) {
		this.quarter = quarter;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getWorkloadFileName() {
		return workloadFileName;
	}

	public void setWorkloadFileName(String workloadFileName) {
		this.workloadFileName = workloadFileName;
	}

	public String getFinishDate() {
		return finishDate;
	}

	public void setFinishDate(String finishDate) {
		this.finishDate = finishDate;
	}

	public void setRecordService(RecordService recordService) {
		this.recordService = recordService;
	}
}